<script setup lang="ts">
import { reactive } from "vue";

defineOptions({
  name: "Demo",
});

const contentList = reactive([
  { text: "⚡ Vue3 + Vite5", fullWidth: false, color: "#FF6B6B" },
  { text: "🍕 TypeScript", fullWidth: false, color: "#4ECDC4" },
  { text: "✨ Vant4 组件库", fullWidth: false, color: "#45B7D1" },
  { text: "🍍 Pinia 状态管理", fullWidth: false, color: "#96CEB4" },
  { text: "🌀 Tailwindcss 原子类框架", fullWidth: true, color: "#FFEAA7" },
  { text: "🗺️ Vue-router 4", fullWidth: false, color: "#DDA0DD" },
  { text: "👏 集成多种图标方案", fullWidth: false, color: "#98D8C8" },
  { text: "🔧 集成 ESLint", fullWidth: false, color: "#F7DC6F" },
  { text: "🌓 支持深色模式", fullWidth: false, color: "#BB8FCE" },
  { text: "📏 vmin 视口适配", fullWidth: false, color: "#85C1E9" },
  { text: "📡 Axios 封装", fullWidth: false, color: "#F8C471" },
  { text: "📦 打包资源 gzip 压缩", fullWidth: false, color: "#82E0AA" },
  { text: "🛠️ 开发 Mock 数据", fullWidth: false, color: "#F1948A" },
  { text: "🚀 首屏加载动画", fullWidth: false, color: "#85C1E9" },
  { text: "🔍 开发环境调试面板", fullWidth: false, color: "#D7BDE2" },
]);
</script>

<template>
  <div class="clay-background">
    <div class="demo-content px-[16px]">
      <!-- Logo区域 -->
      <div class="logo-container">
        <div class="logo-clay-card">
          <img
            class="logo-image"
            alt="Vue logo"
            src="~@/assets/logo_melomini.png"
          />
        </div>
      </div>

      <!-- 主要信息卡片 -->
      <div class="main-info-card">
        <div class="card-header">
          <a
            class="github-link"
            href="https://github.com/yulimchen/vue3-h5-template"
            target="_blank"
          >
            <div class="github-icon-wrapper">
              <svg-icon class="github-icon" name="github" />
            </div>
            <h3 class="project-title">Vue3-h5-template</h3>
            <div class="link-icon-wrapper">
              <svg-icon class="link-icon" name="link" />
            </div>
          </a>
        </div>
        <p class="project-description">
          🌱 基于 Vue3 全家桶、TypeScript、Vite 构建工具，开箱即用的 H5
          移动端项目基础模板，便于快捷开发
        </p>
      </div>

      <!-- 功能特性网格 -->
      <div class="features-grid">
        <div
          v-for="item in contentList"
          :key="item.text"
          :class="['feature-card', item.fullWidth ? 'feature-card-full' : '']"
          :style="{ backgroundColor: item.color }"
        >
          <span class="feature-text">{{ item.text }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
/* 黏土风格背景 */
.clay-background {
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f3f0 0%, #e8e2db 100%);
  position: relative;
  overflow: hidden;
}

.clay-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 30%,
      rgba(255, 107, 107, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(78, 205, 196, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 80%,
      rgba(150, 206, 180, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.demo-content {
  position: relative;
  z-index: 1;
  padding-top: 40px;
  padding-bottom: 40px;
}

/* Logo区域样式 */
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.logo-clay-card {
  background: #ffffff;
  border-radius: 32px;
  padding: 24px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: rotate(-2deg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-clay-card:hover {
  transform: rotate(0deg) scale(1.05);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.logo-image {
  width: 80px;
  height: 80px;
  display: block;
  border-radius: 16px;
}

/* 主要信息卡片样式 */
.main-info-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: rotate(1deg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-info-card:hover {
  transform: rotate(0deg);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.card-header {
  margin-bottom: 16px;
}

.github-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.github-link:hover {
  transform: translateY(-2px);
}

.github-icon-wrapper {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 8px;
  margin-right: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.github-icon {
  font-size: 20px;
  color: #333;
}

.project-title {
  font-weight: bold;
  font-size: 18px;
  margin: 0;
  flex: 1;
  color: #2c3e50;
}

.link-icon-wrapper {
  background: #e3f2fd;
  border-radius: 8px;
  padding: 4px;
  margin-left: 8px;
}

.link-icon {
  font-size: 12px;
  color: #1976d2;
}

.project-description {
  line-height: 1.6;
  margin: 0;
  color: #5d6d7e;
  font-size: 14px;
}

/* 功能特性网格样式 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding-bottom: 24px;
}

.feature-card {
  padding: 16px;
  border-radius: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #2c3e50;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.feature-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

.feature-card:hover::before {
  opacity: 1;
  animation: shimmer 1.5s ease-in-out;
}

.feature-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.feature-card-full {
  grid-column: span 2;
}

.feature-text {
  position: relative;
  z-index: 1;
  display: block;
  line-height: 1.4;
}

/* 动画效果 */
@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* 响应式设计 */
@media (max-width: 480px) {
  .demo-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .logo-clay-card {
    padding: 20px;
  }

  .logo-image {
    width: 64px;
    height: 64px;
  }

  .main-info-card {
    padding: 20px;
  }

  .features-grid {
    gap: 12px;
  }

  .feature-card {
    padding: 14px;
    font-size: 12px;
  }
}

/* 深色模式适配 */
html.dark .clay-background {
  background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
}

html.dark .logo-clay-card,
html.dark .main-info-card {
  background: #3a3a3c;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

html.dark .project-title {
  color: #f5f5f5;
}

html.dark .project-description {
  color: #b0b0b0;
}

html.dark .github-icon-wrapper {
  background: #4a4a4c;
}

html.dark .github-icon {
  color: #f5f5f5;
}

html.dark .feature-card {
  color: #2c3e50;
  border-color: rgba(255, 255, 255, 0.2);
}
</style>
